package com.hong.atomic;

/**
 * @Auther: Administrator
 * @Date: 2018/7/18 11:46
 * @Description:
 */
public class JITTest {
    private volatile static boolean init = false;

    public static void main(String[] args) throws InterruptedException {
        new Thread(){
            @Override
            public void run() {
                while (!init){
                }
            }
        }.start();
        Thread.sleep(1000);

        new Thread(){
            @Override
            public void run() {
                init = true;
                System.out.println("Set init to true.");
            }
        }.start();

    }
}
